import type { LocationQueryValue } from 'vue-router';
import axiosInstance from '../untils/request';
namespace Login {
  // 登录记接
  export interface Ilogin {
    username: string;
    pass: string;
  }
  // 登录返回数据

  // 权限信息
  interface ILoginMenu {
    checked: number;
    children: null;
    ico: string | null;
    id: number;
    name: string;
    pid: number;
    postion: null | string;
    sort: number;
    url: string | null;
  }
  // 用户信息
  export interface RootObjectmodel {
    id: number;
    username: string;
    pass: string;
    oldpass?: any;
    name: string;
    tel?: any;
    depid: number;
    depname: string;
    roleid: number;
    rolename: string;
    openid: string;
    nickname?: any;
    headimgurl?: any;
    bindwatchet: boolean;
  }

  //学生考试列表
  export interface studentTest {
    testid: string;
    page: number;
    psize: number;
    state: string;
    key: string;
  }
  export interface IloginData {
    [x: string]: any;
    token: string;
    menu: ILoginMenu[];
    model: RootObjectmodel;
  }
  export interface ClassesList {
    depid: number;
  }
  export interface QuestionList {
    testid: LocationQueryValue | LocationQueryValue[];
    studentid: number;
  }
  export interface TestList {
    page: number;
    psize: number;
    isread: number;
    key: string;
  }
  export interface TeacherAdds {
    name: string;
    username: string;
    pass: string;
    tel: string;
    depid: string;
    roleid: string;
  }
  export interface TeacherChange {
    oldpass: string;
    pass: string;
  }
  export interface TeacherDelets {
    id: number;
  }
  export interface Teacher {
    page: number;
    psize: number;
    depid: number;
    key: string;
  }
}
// 点击登录
export const GetLogin:any = (params: Login.Ilogin) =>{
  return axiosInstance.post<Login.IloginData>('/teacher/checklogin', params);
}